import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DailyIncomeStatisticsVO, DailyIncomeStatisticsForm, DailyIncomeStatisticsQuery } from '@/api/business/dailyIncomeStatistics/types';

/**
 * 查询日收益统计列表
 * @param query
 * @returns {*}
 */

export const listDailyIncomeStatistics = (query?: DailyIncomeStatisticsQuery): AxiosPromise<DailyIncomeStatisticsVO[]> => {
  return request({
    url: '/business/dailyIncomeStatistics/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询日收益统计详细
 * @param id
 */
export const getDailyIncomeStatistics = (id: string | number): AxiosPromise<DailyIncomeStatisticsVO> => {
  return request({
    url: '/business/dailyIncomeStatistics/' + id,
    method: 'get'
  });
};

/**
 * 新增日收益统计
 * @param data
 */
export const addDailyIncomeStatistics = (data: DailyIncomeStatisticsForm) => {
  return request({
    url: '/business/dailyIncomeStatistics',
    method: 'post',
    data: data
  });
};

/**
 * 修改日收益统计
 * @param data
 */
export const updateDailyIncomeStatistics = (data: DailyIncomeStatisticsForm) => {
  return request({
    url: '/business/dailyIncomeStatistics',
    method: 'put',
    data: data
  });
};

/**
 * 删除日收益统计
 * @param id
 */
export const delDailyIncomeStatistics = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/dailyIncomeStatistics/' + id,
    method: 'delete'
  });
};
